import 'package:json_annotation/json_annotation.dart';

import 'circle_detail_model.dart';

/// code : "string"
/// data : {"content":[{"id":0,"ada":"string","amwayId":"string","auditStatus":"NONE","createTime":0,"description":"string","displayAudits":[{"id":0,"data":"string","no":0,"propertyNameTip":"PG_NICK","resourceType":"TEXT","status":"NONE"}],"no":0,"officialFlag":"NO","product":{"approvalStatus":"string","itemSku":"itemSku","orderable":true,"pdpVideoUrl":"http://xxx","picture":"http://xxxx.png","priceData":{"currency":"RMB","price":100,"saleStatus":"string","skuCode":9801},"productCode":"商品编码","productName":"安利xxx","skuAmount":1,"skuCode":"skuCode","skuName":"安利xxx","skuUnitAmount":0,"skuUnitName":"string","specDescription":"string","specUnitAmount":0,"specUnitName":"string","tagList":["string"],"unitAmount":1,"unitName":"件","updateTime":0},"publishStatus":"UN_PUBLISH","sortId":"string"}],"number":0,"numberOfElements":0,"size":0,"totalElements":0,"totalPages":0}
/// message : "string"

class HaowuProductModels {
  String _code;
  HaowuData _data;
  String _message;

  String get code => _code;

  HaowuData get data => _data;

  String get message => _message;

  HaowuProductModels({String code, HaowuData data, String message}) {
    _code = code;
    _data = data;
    _message = message;
  }

  HaowuProductModels.fromJson(dynamic json) {
    _code = json["code"];
    _data = json["data"] != null ? HaowuData.fromJson(json["data"]) : null;
    _message = json["message"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["code"] = _code;
    if (_data != null) {
      map["data"] = _data.toJson();
    }
    map["message"] = _message;
    return map;
  }
}

/// content : [{"id":0,"ada":"string","amwayId":"string","auditStatus":"NONE","createTime":0,"description":"string","displayAudits":[{"id":0,"data":"string","no":0,"propertyNameTip":"PG_NICK","resourceType":"TEXT","status":"NONE"}],"no":0,"officialFlag":"NO","product":{"approvalStatus":"string","itemSku":"itemSku","orderable":true,"pdpVideoUrl":"http://xxx","picture":"http://xxxx.png","priceData":{"currency":"RMB","price":100,"saleStatus":"string","skuCode":9801},"productCode":"商品编码","productName":"安利xxx","skuAmount":1,"skuCode":"skuCode","skuName":"安利xxx","skuUnitAmount":0,"skuUnitName":"string","specDescription":"string","specUnitAmount":0,"specUnitName":"string","tagList":["string"],"unitAmount":1,"unitName":"件","updateTime":0},"publishStatus":"UN_PUBLISH","sortId":"string"}]
/// number : 0
/// numberOfElements : 0
/// size : 0
/// totalElements : 0
/// totalPages : 0

class HaowuData {
  List<HaowuContent> _content;
  int _number;
  int _numberOfElements;
  int _size;
  int _totalElements;
  int _totalPages;

  List<HaowuContent> get content => _content;

  int get number => _number;

  int get numberOfElements => _numberOfElements;

  int get size => _size;

  int get totalElements => _totalElements;

  int get totalPages => _totalPages;

  HaowuData(
      {List<HaowuContent> content,
      int number,
      int numberOfElements,
      int size,
      int totalElements,
      int totalPages}) {
    _content = content;
    _number = number;
    _numberOfElements = numberOfElements;
    _size = size;
    _totalElements = totalElements;
    _totalPages = totalPages;
  }

  HaowuData.fromJson(dynamic json) {
    if (json["content"] != null) {
      _content = [];
      json["content"].forEach((v) {
        _content.add(HaowuContent.fromJson(v));
      });
    }
    _number = json["number"];
    _numberOfElements = json["numberOfElements"];
    _size = json["size"];
    _totalElements = json["totalElements"];
    _totalPages = json["totalPages"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    if (_content != null) {
      map["content"] = _content.map((v) => v.toJson()).toList();
    }
    map["number"] = _number;
    map["numberOfElements"] = _numberOfElements;
    map["size"] = _size;
    map["totalElements"] = _totalElements;
    map["totalPages"] = _totalPages;
    return map;
  }
}

/// id : 0
/// ada : "string"
/// amwayId : "string"
/// auditStatus : "NONE"
/// createTime : 0
/// description : "string"
/// displayAudits : [{"id":0,"data":"string","no":0,"propertyNameTip":"PG_NICK","resourceType":"TEXT","status":"NONE"}]
/// no : 0
/// officialFlag : "NO"
/// product : {"approvalStatus":"string","itemSku":"itemSku","orderable":true,"pdpVideoUrl":"http://xxx","picture":"http://xxxx.png","priceData":{"currency":"RMB","price":100,"saleStatus":"string","skuCode":9801},"productCode":"商品编码","productName":"安利xxx","skuAmount":1,"skuCode":"skuCode","skuName":"安利xxx","skuUnitAmount":0,"skuUnitName":"string","specDescription":"string","specUnitAmount":0,"specUnitName":"string","tagList":["string"],"unitAmount":1,"unitName":"件","updateTime":0}
/// publishStatus : "UN_PUBLISH"
/// sortId : "string"

class HaowuContent {
  String _id;
  String _ada;
  String _amwayId;
  String _auditStatus;
  int _createTime;
  String _description;
  List<DisplayAudits> _displayAudits;
  int _no;
  String _officialFlag;
  HaowuProduct _product;

  set auditStatus(String value) {
    _auditStatus = value;
  }

  String _publishStatus;
  String _sortId;

  String get id => _id;

  String get ada => _ada;

  String get amwayId => _amwayId;

  String get auditStatus => _auditStatus;

  int get createTime => _createTime;

  String get description => _description;

  set description(String value) {
    _description = value;
  }

  List<DisplayAudits> get displayAudits => _displayAudits;

  int get no => _no;

  set no(int value) {
    _no = value;
  }

  String get officialFlag => _officialFlag;

  HaowuProduct get product => _product;

  set id(String value) {
    _id = value;
  }

  String get publishStatus => _publishStatus;

  String get sortId => _sortId;

  set sortId(String value) {
    _sortId = value;
  }

  /******************下方为前端字段*******************/
  bool _isEdited = false;

  bool _showEmptyNotification = false;
  bool _showLengthExceededWarning = false;

  bool get showLengthExceededWarning => _showLengthExceededWarning;

  set showLengthExceededWarning(bool value) {
    _showLengthExceededWarning = value;
  }

  bool get showEmptyNotification => _showEmptyNotification;

  set showEmptyNotification(bool value) {
    _showEmptyNotification = value;
  }

  bool get isEdited => _isEdited;

  set isEdited(bool value) {
    _isEdited = value;
  }

  HaowuContent(
      {String id,
      String ada,
      String amwayId,
      String auditStatus,
      int createTime,
      String description,
      List<DisplayAudits> displayAudits,
      int no,
      String officialFlag,
      HaowuProduct product,
      String publishStatus,
      String sortId}) {
    _id = id;
    _ada = ada;
    _amwayId = amwayId;
    _auditStatus = auditStatus;
    _createTime = createTime;
    _description = description;
    _displayAudits = displayAudits;
    _no = no;
    _officialFlag = officialFlag;
    _product = product;
    _publishStatus = publishStatus;
    _sortId = sortId;
  }

  HaowuContent.fromJson(dynamic json) {
    _id = json["id"];
    _ada = json["ada"];
    _amwayId = json["amwayId"];
    _auditStatus = json["auditStatus"];
    _createTime = json["createTime"];
    _description = json["description"];
    if (json["displayAudits"] != null) {
      _displayAudits = [];
      json["displayAudits"].forEach((v) {
        _displayAudits.add(DisplayAudits.fromJson(v));
      });
    }
    _no = json["no"];
    _officialFlag = json["officialFlag"];
    _product =
        json["product"] != null ? HaowuProduct.fromJson(json["product"]) : null;
    _publishStatus = json["publishStatus"];
    _sortId = json["sortId"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["id"] = _id;
    map["ada"] = _ada;
    map["amwayId"] = _amwayId;
    map["auditStatus"] = _auditStatus;
    map["createTime"] = _createTime;
    map["description"] = _description;
    if (_displayAudits != null) {
      map["displayAudits"] = _displayAudits.map((v) => v.toJson()).toList();
    }
    map["no"] = _no;
    map["officialFlag"] = _officialFlag;
    if (_product != null) {
      map["product"] = _product.toJson();
    }
    map["publishStatus"] = _publishStatus;
    map["sortId"] = _sortId;
    return map;
  }

  set ada(String value) {
    _ada = value;
  }

  set amwayId(String value) {
    _amwayId = value;
  }

  set createTime(int value) {
    _createTime = value;
  }

  set displayAudits(List<DisplayAudits> value) {
    _displayAudits = value;
  }

  set officialFlag(String value) {
    _officialFlag = value;
  }

  set product(HaowuProduct value) {
    _product = value;
  }

  set publishStatus(String value) {
    _publishStatus = value;
  }
}

/// approvalStatus : "string"
/// itemSku : "itemSku"
/// orderable : true
/// pdpVideoUrl : "http://xxx"
/// picture : "http://xxxx.png"
/// priceData : {"currency":"RMB","price":100,"saleStatus":"string","skuCode":9801}
/// productCode : "商品编码"
/// productName : "安利xxx"
/// skuAmount : 1
/// skuCode : "skuCode"
/// skuName : "安利xxx"
/// skuUnitAmount : 0
/// skuUnitName : "string"
/// specDescription : "string"
/// specUnitAmount : 0
/// specUnitName : "string"
/// tagList : ["string"]
/// unitAmount : 1
/// unitName : "件"
/// updateTime : 0
@JsonSerializable()
class HaowuProduct {
  String _approvalStatus;
  String _itemSku;
  bool _orderable;
  String _pdpVideoUrl;
  String _picture;
  PriceData _priceData;
  String _productCode;
  String _productName;
  dynamic _skuAmount;
  String _skuCode;
  String _skuName;
  dynamic _skuUnitAmount;
  String _skuUnitName;
  String _specDescription;
  dynamic _specUnitAmount;
  String _specUnitName;
  List<String> _tagList;
  dynamic _unitAmount;
  String _unitName;
  int _updateTime;

  /*以下为前端字段*/
  bool _isHidden = false;

  bool get isHidden => _isHidden;

  bool _isChecked = false;

  bool get isChecked => _isChecked;

  set isChecked(bool value) {
    _isChecked = value;
  }

  set isHidden(bool value) {
    _isHidden = value;
  }

  String get approvalStatus => _approvalStatus;

  String get itemSku => _itemSku;

  bool get orderable => _orderable;

  String get pdpVideoUrl => _pdpVideoUrl;

  String get picture => _picture;

  PriceData get priceData => _priceData;

  set approvalStatus(String value) {
    _approvalStatus = value;
  }

  String get productCode => _productCode;

  String get productName => _productName;

  dynamic get skuAmount => _skuAmount;

  String get skuCode => _skuCode;

  String get skuName => _skuName;

  dynamic get skuUnitAmount => _skuUnitAmount;

  String get skuUnitName => _skuUnitName;

  String get specDescription => _specDescription;

  dynamic get specUnitAmount => _specUnitAmount;

  String get specUnitName => _specUnitName;

  List<String> get tagList => _tagList;

  dynamic get unitAmount => _unitAmount;

  String get unitName => _unitName;

  int get updateTime => _updateTime;

  HaowuProduct(
      {String approvalStatus,
      String itemSku,
      bool orderable,
      String pdpVideoUrl,
      String picture,
      PriceData priceData,
      String productCode,
      String productName,
      dynamic skuAmount,
      String skuCode,
      String skuName,
      dynamic skuUnitAmount,
      String skuUnitName,
      String specDescription,
      dynamic specUnitAmount,
      String specUnitName,
      List<String> tagList,
      dynamic unitAmount,
      String unitName,
      int updateTime}) {
    _approvalStatus = approvalStatus;
    _itemSku = itemSku;
    _orderable = orderable ?? true;
    _pdpVideoUrl = pdpVideoUrl;
    _picture = picture;
    _priceData = priceData;
    _productCode = productCode;
    _productName = productName;
    _skuAmount = skuAmount;
    _skuCode = skuCode;
    _skuName = skuName;
    _skuUnitAmount = skuUnitAmount;
    _skuUnitName = skuUnitName;
    _specDescription = specDescription;
    _specUnitAmount = specUnitAmount;
    _specUnitName = specUnitName;
    _tagList = tagList;
    _unitAmount = unitAmount;
    _unitName = unitName;
    _updateTime = updateTime;
  }

  @override
  bool operator ==(Object other) {}

  HaowuProduct.fromJson(dynamic json) {
    _approvalStatus = json["approvalStatus"];
    _itemSku = json["itemSku"];
    _orderable = json["orderable"];
    _pdpVideoUrl = json["pdpVideoUrl"];
    _picture = json["picture"];
    _priceData = json["priceData"] != null
        ? PriceData.fromJson(json["priceData"])
        : null;
    _productCode = json["productCode"];
    _productName = json["productName"];
    _skuAmount = json["skuAmount"];
    _skuCode = json["skuCode"];
    _skuName = json["skuName"];
    _skuUnitAmount = json["skuUnitAmount"];
    _skuUnitName = json["skuUnitName"];
    _specDescription = json["specDescription"];
    _specUnitAmount = json["specUnitAmount"];
    _specUnitName = json["specUnitName"];
    _tagList = json["tagList"] != null ? json["tagList"].cast<String>() : [];
    _unitAmount = json["unitAmount"];
    _unitName = json["unitName"];
    _updateTime = json["updateTime"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["approvalStatus"] = _approvalStatus;
    map["itemSku"] = _itemSku;
    map["orderable"] = _orderable;
    map["pdpVideoUrl"] = _pdpVideoUrl;
    map["picture"] = _picture;
    if (_priceData != null) {
      map["priceData"] = _priceData.toJson();
    }
    map["productCode"] = _productCode;
    map["productName"] = _productName;
    map["skuAmount"] = _skuAmount;
    map["skuCode"] = _skuCode;
    map["skuName"] = _skuName;
    map["skuUnitAmount"] = _skuUnitAmount;
    map["skuUnitName"] = _skuUnitName;
    map["specDescription"] = _specDescription;
    map["specUnitAmount"] = _specUnitAmount;
    map["specUnitName"] = _specUnitName;
    map["tagList"] = _tagList;
    map["unitAmount"] = _unitAmount;
    map["unitName"] = _unitName;
    map["updateTime"] = _updateTime;
    return map;
  }

  set itemSku(String value) {
    _itemSku = value;
  }

  set orderable(bool value) {
    _orderable = value;
  }

  set pdpVideoUrl(String value) {
    _pdpVideoUrl = value;
  }

  set picture(String value) {
    _picture = value;
  }

  set priceData(PriceData value) {
    _priceData = value;
  }

  set productCode(String value) {
    _productCode = value;
  }

  set productName(String value) {
    _productName = value;
  }

  set skuAmount(dynamic value) {
    _skuAmount = value;
  }

  set skuCode(String value) {
    _skuCode = value;
  }

  set skuName(String value) {
    _skuName = value;
  }

  set skuUnitAmount(dynamic value) {
    _skuUnitAmount = value;
  }

  set skuUnitName(String value) {
    _skuUnitName = value;
  }

  set specDescription(String value) {
    _specDescription = value;
  }

  set specUnitAmount(dynamic value) {
    _specUnitAmount = value;
  }

  set specUnitName(String value) {
    _specUnitName = value;
  }

  set tagList(List<String> value) {
    _tagList = value;
  }

  set unitAmount(dynamic value) {
    _unitAmount = value;
  }

  set unitName(String value) {
    _unitName = value;
  }

  set updateTime(int value) {
    _updateTime = value;
  }
}

/// currency : "RMB"
/// price : 100
/// saleStatus : "string"
/// skuCode : 9801

/// id : 0
/// data : "string"
/// no : 0
/// propertyNameTip : "PG_NICK"
/// resourceType : "TEXT"
/// status : "NONE"

class DisplayAudits {
  int _id;
  String _data;
  int _no;
  String _propertyNameTip;
  String _resourceType;
  String _status;

  int get id => _id;

  String get data => _data;

  int get no => _no;

  String get propertyNameTip => _propertyNameTip;

  String get resourceType => _resourceType;

  String get status => _status;

  DisplayAudits(
      {int id,
      String data,
      int no,
      String propertyNameTip,
      String resourceType,
      String status}) {
    _id = id;
    _data = data;
    _no = no;
    _propertyNameTip = propertyNameTip;
    _resourceType = resourceType;
    _status = status;
  }

  DisplayAudits.fromJson(dynamic json) {
    _id = json["id"];
    _data = json["data"];
    _no = json["no"];
    _propertyNameTip = json["propertyNameTip"];
    _resourceType = json["resourceType"];
    _status = json["status"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["id"] = _id;
    map["data"] = _data;
    map["no"] = _no;
    map["propertyNameTip"] = _propertyNameTip;
    map["resourceType"] = _resourceType;
    map["status"] = _status;
    return map;
  }
}
